package com.itheima.health.h5.controller;

import com.itheima.health.entity.Result;
import com.itheima.health.service.SetmealService;
import com.itheima.health.vo.SetmealVO;
import io.swagger.annotations.Api;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.*;

/**
 * @program: health_paret
 * @description:
 * @author: Mr.Wang
 * @create: 2020-11-11 09:45
 **/
@Api(tags = "移动端的套餐管理")
@RequestMapping("setmeal")
@RestController
public class SetMealController {
    @Reference
    private SetmealService setmealService;

    //移动端进行页面所有套餐的查找
    @GetMapping("findAllSetmeal")
    public Result findAllSetmeal() {
        return new Result(true, "查找成功", setmealService.list());
    }

    @GetMapping("findSetMealDetail/{id}")
    public Result findSetMealDetail(@PathVariable("id") int id) {
        SetmealVO x = setmealService.findSetMealDetail(id);
        return new Result(true, "查找成功",x);
    }
}
